import java.util.Arrays;

public class Text {
    public static void main(String[] args) {
        Binarytree tree=new Binarytree();
        String str="a##";
        Binarytree.TreeNode root=tree.createTree();
        int size=tree.size(root);
        System.out.println("树中节点的个数: "+size);

        int leafTreeCount=tree.getLeafNodeCount(root);
        System.out.println("叶子节点的个数: "+leafTreeCount);

        int getKLevelNodeCount=tree.getKLevelNodeCount(root,3);
        System.out.println("第K层节点的个数: "+getKLevelNodeCount);

        System.out.println("获取二叉树的高度: "+tree.getHeight(root));

        Binarytree.TreeNode ret=tree.find(root,'B');
        System.out.println("检测值为value的元素是否存在: " +ret.val);
        System.out.println("判断一棵树是不是完全二叉树:"+
                tree.isCompleteTree(root));

        System.out.println("======前序遍历=======");
        tree.preOrder(root);
        System.out.println( );

        System.out.println("======中序遍历=======");
        tree.inOrder(root);
        System.out.println( );

        System.out.println("======后序遍历=======");
        tree.postOrder(root);
        System.out.println( );

        System.out.println("======层序遍历=======");
        tree.levelOrder(root);
        System.out.println( );
    }
}
